Repository navigation
Conversation
| this._menuOpen ? this.onMenuOpen.emit() : this.onMenuClose.emit(); | ||
|
|
||
| if (this._menuOpen) { | ||
| this.onMenuOpen.emit(); |
There was a problem hiding this comment.
Rather than having to emit to multiple subjects, why not have something like:
@Output() onMenuOpen = new EventEmitter<void>();
@Output() onMenuOpened = this.onMenuOpen;
There was a problem hiding this comment.
Thanks for the feedback! Done :)
| * Event emitted when the menu is closed. | ||
| * @deprecated Switch to `closed` instead | ||
| */ | ||
| @Output() close = this.closed; |
There was a problem hiding this comment.
That's fine by me, just need to mark it as a breaking change or deprecated.
There was a problem hiding this comment.
@jelbourn - Ok, to verify we want to changeopen and close to openChange with a signature like:
export interface MdMenuEvent {
opened: boolean;
type: void | 'click' | 'keydown'
}
| if (this.menu.close) { | ||
| this.menu.close.emit(); | ||
| } | ||
| this.menu.closed.emit(); |
There was a problem hiding this comment.
Do you need this any more?
| this.menu.close.emit(); | ||
| if (this.menu.close) { | ||
| this.menu.close.emit(); | ||
| } |
| this._createOverlay().attach(this._portal); | ||
| this._closeSubscription = this._menuClosingActions().subscribe(() => this.menu.close.emit()); | ||
| this._closeSubscription = this._menuClosingActions().subscribe(() => { | ||
| if (this.menu.close) { |
There was a problem hiding this comment.
Why do we need this null check? The close emitter should always be there.
There was a problem hiding this comment.
On the interface MdMenuPanel it declared a close EventEmitter. As part of this deprecation, I made that an optional interface and made closed the new interface. The implementation of this required I add a null check in those spots. If we are ok with removing that from the interface, we can remove all of this.
| this._overlayRef.detach(); | ||
| this._closeSubscription.unsubscribe(); | ||
| this.menu.close.emit(); | ||
| if (this.menu.close) { |
There was a problem hiding this comment.
We shouldn't need this null check either.
| this._tabSubscription = this._keyManager.tabOut.subscribe(() => this.close.emit('keydown')); | ||
| this._tabSubscription = this._keyManager.tabOut.subscribe(() => { | ||
| this.close.emit('keydown'); | ||
| this.closed.emit('keydown'); |
There was a problem hiding this comment.
You shouldn't emit to both of these anymore. Since they're pointing to the same emitter, you'll end up emitting the same event twice.
|
Updated minus the new api question above. |
|
The hover event is internal, I added it to accommodate the nested menus. |
|
Ack, @amcdnl can you change |
|
@jelbourn - done. |
|
Caretaker note: should be completely backwards compatible, so if something fails there's a bug |
|
Closing of favor of #8053 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Updates the Menu API with the following API modifications per #6677
closetoclosedhovertohoveredonMenuOpentomenuOpenedonMenuClosetomenuClosed